subroutine  grides
use var
implicit none

    integer j,i
    real(8) pi
    
    select case(c_init_case)  
    case(1,24)
        !t_end=0.14
        t_end = 0.2d0
        CFL=0.5d0
        
        upx=1.d0
        downx=0.d0
        upy=1.d0
        downy=0.d0
        
        pi=2.d0*dasin(1.d0)
        dx=(upx-downx)/dble(gridsx)
        dy=(upy-downy)/dble(gridsy)
    case(2)
        !t_end=0.14
        t_end = 0.13d0
        CFL=0.5d0
        
        upx=1.d0
        downx=0.d0
        upy=1.d0
        downy=0.d0
        
        pi=2.d0*dasin(1.d0)
        dx=(upx-downx)/dble(gridsx)
        dy=(upy-downy)/dble(gridsy)
    case(3,4)
        t_end = 0.1d0
        CFL=0.5d0
        
        upx=1.d0
        downx=0.d0
        upy=1.d0
        downy=0.d0
        
        pi=2.d0*dasin(1.d0)
        dx=(upx-downx)/dble(gridsx)
        dy=(upy-downy)/dble(gridsy)
    case(10)
        t_end=0.038d0
        CFL=0.5d0
        
        upx=1.d0
        downx=0.d0
        upy=1.d0
        downy=0.d0
        
        pi=2.d0*dasin(1.d0)
        dx=(upx-downx)/dble(gridsx)
        dy=(upy-downy)/dble(gridsy)
    case(11)
        t_end=1.8d0
        CFL=0.5d0
        
        upx=5.d0
        downx=-5.d0
        upy=1.d0
        downy=0.d0
        
        pi=2.d0*dasin(1.d0)
        dx=(upx-downx)/dble(gridsx)
        dy=(upy-downy)/dble(gridsy)
    case(13)
        t_end=0.5d0
        CFL=0.5d0        
        
        upx=1.d0
        downx=-1.d0
        upy=1.d0
        downy=-1.d0
        
        pi=2.d0*dasin(1.d0)
        dx=(upx-downx)/dble(gridsx)
        dy=(upy-downy)/dble(gridsy)
    case(14)
        t_end=0.5d0
        CFL=0.5d0        
        
        upx=1.d0
        downx=-1.d0
        upy=1.d0
        downy=-1.d0
        
        pi=2.d0*dasin(1.d0)
        dx=(upx-downx)/dble(gridsx)
        dy=(upy-downy)/dble(gridsy)
    case(15)
        t_end=0.5d0
        CFL=0.5d0        
        
        upx=1.d0
        downx=-1.d0
        upy=1.d0
        downy=-1.d0
        
        pi=2.d0*dasin(1.d0)
        dx=(upx-downx)/dble(gridsx)
        dy=(upy-downy)/dble(gridsy)
    case(16)
        t_end=0.5d0
        CFL=0.5d0        
        
        upx=1.d0
        downx=-1.d0
        upy=1.d0
        downy=-1.d0
        
        pi=2.d0*dasin(1.d0)
        dx=(upx-downx)/dble(gridsx)
        dy=(upy-downy)/dble(gridsy)
    case(17)
        t_end=0.4d0
        CFL=0.5d0        
        
        upx=1.d0
        downx=-1.d0
        upy=1.d0
        downy=-1.d0
        
        pi=2.d0*dasin(1.d0)
        dx=(upx-downx)/dble(gridsx)
        dy=(upy-downy)/dble(gridsy)
    case(18)
        t_end=0.47d0
        CFL=0.5d0        
        
        upx=1.d0
        downx=-1.d0
        upy=1.d0
        downy=-1.d0
        
        pi=2.d0*dasin(1.d0)
        dx=(upx-downx)/dble(gridsx)
        dy=(upy-downy)/dble(gridsy)
    case(19)
        t_end=0.345d0
        CFL=0.5d0        
        
        upx=1.d0
        downx=-1.d0
        upy=1.d0
        downy=-1.d0
        
        pi=2.d0*dasin(1.d0)
        dx=(upx-downx)/dble(gridsx)
        dy=(upy-downy)/dble(gridsy)
    case(20)
        t_end=0.5d0
        CFL=0.5d0        
        
        upx=1.d0
        downx=-1.d0
        upy=1.d0
        downy=-1.d0
        
        pi=2.d0*dasin(1.d0)
        dx=(upx-downx)/dble(gridsx)
        dy=(upy-downy)/dble(gridsy)
    case(21)
        t_end=0.45d0
        CFL=0.5d0        
        
        upx=1.d0
        downx=-1.d0
        upy=1.d0
        downy=-1.d0
        
        pi=2.d0*dasin(1.d0)
        dx=(upx-downx)/dble(gridsx)
        dy=(upy-downy)/dble(gridsy)
    case(22)
        t_end=0.3d0
        CFL=0.5d0        
        
        upx=1.d0
        downx=-1.d0
        upy=1.d0
        downy=-1.d0
        
        pi=2.d0*dasin(1.d0)
        dx=(upx-downx)/dble(gridsx)
        dy=(upy-downy)/dble(gridsy)
    case(23)
        t_end=0.3d0
        CFL=0.45d0        
        
        upx=2.5d0
        downx=-2.5d0
        upy=1.d0
        downy=-1.d0
        
        pi=2.d0*dasin(1.d0)
        dx=(upx-downx)/dble(gridsx)
        dy=(upy-downy)/dble(gridsy)
    case(27)
        t_end=0.3d0
        CFL=0.45d0        
        
        upx=2.5d0
        downx=-2.5d0
        upy=1.d0
        downy=-1.d0
        
        pi=2.d0*dasin(1.d0)
        dx=(upx-downx)/dble(gridsx)
        dy=(upy-downy)/dble(gridsy)
    case(28)
        !t_end=0.14
        t_end = 0.2d0
        CFL=0.5d0
        
        upx=1.d0
        downx=0.d0
        upy=1.d0
        downy=0.d0
        
        pi=2.d0*dasin(1.d0)
        dx=(upx-downx)/dble(gridsx)
        dy=(upy-downy)/dble(gridsy)
        
        
        
    
    case default
        stop'grides: zero pivot at first row'
    endselect
    !
    do i=0,gridsx
        x(i)=downx+dble(i)*dx
        !y(i,j)=downy+dble(j)*dy
    enddo
    
    do i=1,gridsx
        xc(i)=downx+dble(i)*dx-0.5d0*dx
        !yc(i,j)=downy+dble(j)*dy-0.5d0*dy
    enddo 

end subroutine